home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / doc / python-apt / examples / desc.py < prev    next >
Encoding:
Text File  |  2009-03-30  |  439 b   |  25 lines

  1.  
  2. import apt_pkg
  3.  
  4. apt_pkg.init()
  5.  
  6. apt_pkg.Config.Set("APT::Acquire::Translation", "de")
  7.  
  8. cache = apt_pkg.GetCache()
  9. depcache = apt_pkg.GetDepCache(cache)
  10.  
  11. pkg = cache["gcc"]
  12. cand = depcache.GetCandidateVer(pkg)
  13. print cand
  14.  
  15. desc = cand.TranslatedDescription
  16. print desc
  17. print desc.FileList
  18. (f, index) = desc.FileList.pop(0)
  19.  
  20. records = apt_pkg.GetPkgRecords(cache)
  21. records.Lookup((f, index))
  22. desc = records.LongDesc
  23. print len(desc)
  24. print desc
  25.